# coding: utf-8

a = 'abcdefghijklmn'
# 获取索引2到索引8的子串，步长为3
print(a[2:8:3])  # 输出cf
# 获取索引2到索引8的子串，步长为2
print(a[2:8:2])  # 输出ceg
